package joc.contract;

import joc.customize.Contract;
import joc.customize.ForFieldEvaluateAtBeginningOfAllMethods;
import joc.customize.ForFieldEvaluateAtEndOfAllBehaviors;
import joc.customize.ForMethodEvaluateAtEndOfMethodWithReturnValueAndInherit;
import joc.customize.ForParameterEvaluateAtBeginningOfBehavior;
import joc.customize.PartialEvaluationResult;

public class LessThanLongContract extends Contract<LessThanLong> {
	@ForFieldEvaluateAtBeginningOfAllMethods
	@ForFieldEvaluateAtEndOfAllBehaviors
	@ForParameterEvaluateAtBeginningOfBehavior
	@ForMethodEvaluateAtEndOfMethodWithReturnValueAndInherit
	public PartialEvaluationResult checkContract(LessThanLong annotation, long value) {
		return getResult(value < annotation.value(), "Value " + value + " is not less than " + annotation.value() + ".");
	}
}
